package shengchanxiaofeiTest;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

public class Pro implements Runnable{
    @Override
    public void run() {
        while (true){
            Ware.rtl.lock();
            if(Ware.mark){
                try {
                    Ware.pro.await();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }else{
                System.out.println("生产者,生产了包子");
                Ware.mark = true;
                Ware.con.signal();
            }

            Ware.rtl.unlock();
        }
    }
}
